package ar.edu.utn.frba.disenio.aterrizar.fechas;

import ar.edu.utn.frba.disenio.aterrizar.fechas.Internacional;
import ar.edu.utn.frba.disenio.aterrizar.fechas.NoEsParseablePorFormatoException;
import org.junit.Test;
import static org.junit.Assert.*;

public class TestInternacional {
	
	private Internacional inter = new Internacional();
	
	@Test
	public void testDondeParseaBien(){
		String unString = "2012-05-23";
		assertTrue("Parsea bien si el formato es aaaa-mm-dd",(!inter.parsear(unString).equals(null)));
	}
	@Test (expected = NoEsParseablePorFormatoException.class)  
	public  void testErrorPorFormatoLatinoamericano(){
		String unString="23/05/2012";
		inter.parsear(unString);
	}
	@Test (expected = NoEsParseablePorFormatoException.class)  
	public  void testErrorPorFormatoNorteamericano(){
		String unString="05-23-2012";
		inter.parsear(unString);
	}
	
	@Test (expected = NoEsParseablePorFormatoException.class)  
	public  void testFechaVacia(){
		String unString="";
		inter.parsear(unString);
	}
	
	@Test (expected = NoEsParseablePorFormatoException.class)  
	public  void testFechaConSimbolos(){
		String unString="$%^$%^$&$";
		inter.parsear(unString);
	}
	
	@Test (expected = NoEsParseablePorFormatoException.class)  
	public  void testFechaConLetras(){
		String unString="Veintitres de Mayo";
		inter.parsear(unString);
	}
}
